package com.qd.common.panda.domain.entity.shop.order;

import com.cdqidi.valid.group.DefaultGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 商城订单
 *
 * @author sjk
 * @create 2023-07-04 15:08
 * @since 1.0.0
 */
@Data
public class ShopOrderDTO {
    /**
     * 商品编号
     */
    @NotBlank(message = "商品编号不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "商品编号长度不能超过{max}位", groups = DefaultGroup.class)
    private String productCode;
    /**
     * 地址ID
     */
    @NotBlank(message = "地址ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "地址ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String addressId;
    /**
     * 卷ID
     */
    private String cardId;
    /**
     * 用户ID
     */
    private String userId;

    public void freeData() {
        this.productCode = null;
        this.addressId = null;
        this.cardId = null;
        this.userId = null;
    }
}